package com.xja.git.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

public class Category {
    private Integer id;

    private String name;

    private String description;

    private Integer defaultcategory;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    private Date createtime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description == null ? null : description.trim();
    }

    public Integer getDefaultcategory() {
        return defaultcategory;
    }

    public void setDefaultcategory(Integer defaultcategory) {
        this.defaultcategory = defaultcategory;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Category() {
    }

    public Category(Integer id, String name, String description, Integer defaultcategory, Date createtime) {
        this.id = id;
        this.name = name;
        this.description = description;
        this.defaultcategory = defaultcategory;
        this.createtime = createtime;
    }

    public Category(String name, String description, Integer defaultcategory, Date createtime) {
        this.name = name;
        this.description = description;
        this.defaultcategory = defaultcategory;
        this.createtime = createtime;
    }

    @Override
    public String toString() {
        return "Category{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", defaultcategory=" + defaultcategory +
                ", createtime=" + createtime +
                '}';
    }
}